const { merge } = require('webpack-merge')
const common = require('./webpack.common')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const { HotModuleReplacementPlugin } = require('webpack')

module.exports = merge(common, {
  mode: 'development',
  devtool: 'eval-cheap-module-source-map',
  devServer: {
    hot: true,
    port: '8081',
    contentBase: ['./dist', './public'],
  },
  plugins: [
    new HtmlWebpackPlugin({
      title: 'dev - vue app base',
      template: './public/index.html',
      templateParameters: {
        BASE_URL: '/'
      }
    }),
    new HotModuleReplacementPlugin(),
  ]
})
